<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../../../taglib.jsp"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<base href="<%=basePath%>" />
<%@ include file="/webmodules/console/css.jsp"%>
<%@ include file="/webmodules/console/js.jsp"%>
<script type="text/javascript">
	function changeOrg() {
		var org = $('#org').combotree('getValue');
		if (org == '') {
			top.showMsg("提示", "请选择部门！", true, 'warning');
			return;
		}
		var row = top.$('#tabsconetnt').tabs('getSelected').find('iframe')[0].contentWindow.$('#slave_${param.bizcode}').find('iframe')[0].contentWindow.$('#mydatagrid').datagrid('getSelected');
		if (org == row.ORG) {
			top.showMsg("提示", "所属部门未发生变化！", true, 'warning');
			return;
		}
		$.post("dragon/modules/system/user/action/UserHandler/changeOrg.ejw", {
			uid : row.ID,
			orgid : org
		}, function(data) {
			if (data == "t") {
				top.showMsg("", "所属部门变更成功！", false);
				top.$('#tabsconetnt').tabs('getSelected').find('iframe')[0].contentWindow.$('#slave_${param.bizcode}').find('iframe')[0].contentWindow.$('#mydatagrid').datagrid('reload');
				top.closeWindow();
			} else {
				top.showErrorMsg("出错了", data);
			}
		});
	}
</script>
</head>
<body>
	<div id="tree">
		<input type="text" id="org" class="easyui-combotree" url="dragon/modules/system/org/action/OrgHandler/combotree.ejw" />
		<a href="javascript:void(0);" class="easyui-linkbutton" iconCls="icon-ok" onclick="changeOrg();">确定</a>
	</div>
</body>
</html>
